package com.fanbuchi.fukua.activity;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.fanbuchi.fukua.R;
import com.fanbuchi.fukua.activity.base.BaseActivity;
import com.fanbuchi.fukua.fragment.RegFragment;
import com.fanbuchi.fukua.fragment.StartedUpFragmentSingle;

/**
 * Created by rabbit on 2015/6/27.
 * @title qq
 * @title weixin
 * @title weibo
 * @title sms
 * @title 绑定手机imei或者token
 */
public class RegActivity extends BaseActivity  {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_started_up);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new RegFragment())
                    .commit();
        }

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_reg, menu);
        return true;
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        if (id == R.id.actionReg) {
            RegFragment regFragment=(RegFragment) getSupportFragmentManager().findFragmentById(R.id.container);
            regFragment.onRegister();
        }

        return super.onOptionsItemSelected(item);
    }


}
